import request from '@/utils/request'

export const userApi = {
  // 分页查询用户
  getUsers(params) {
    return request.get('/users', { params })
  },
  
  // 获取用户详情
  getUser(id) {
    return request.get(`/users/${id}`)
  },
  
  // 更新用户
  updateUser(id, data) {
    return request.put(`/users/${id}`, data)
  },
  
  // 删除用户
  deleteUser(id) {
    return request.delete(`/users/${id}`)
  },
  
  // 启用/禁用用户
  updateStatus(id, status) {
    return request.put(`/users/${id}/status`, null, {
      params: { status }
    })
  }
}

